package com.zsx.shopping.product.controller;

import com.zsx.shopping.common.api.R;
import com.zsx.shopping.product.service.CategoryService;
import com.zsx.shopping.product.vo.CategoryVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/product/category")
public class CategoryController {

    @Resource
    private CategoryService categoryService;

    @GetMapping("/catalog")
    public R<List<CategoryVO>> getCatalog() {
        return R.success(categoryService.getCatalog());
    }
}
